<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>034-一个feComponentTransfer滤镜</title>
</head>

<body>
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
        <defs>
            <linearGradient id="MyGrad" gradientUnits="userSpaceOnUse" x1="50" y1="0" x2="600" y2="0">
                <stop offset="0" stop-color="#ff0000" />
                <stop offset=".33" stop-color="#00ff00" />
                <stop offset=".67" stop-color="#0000ff" />
                <stop offset="1" stop-color="#000000" />
            </linearGradient>
            <filter id="Identity">
                <feComponentTransfer>
                    <feFuncR type="identity" />
                    <feFuncG type="identity" />
                    <feFuncB type="identity" />
                    <feFuncA type="identity" />
                </feComponentTransfer>
            </filter>
            <filter id="Table">
                <feComponentTransfer>
                    <feFuncR type="table" tableValues="0 0 1 1" />
                    <feFuncG type="table" tableValues="1 1 0 0" />
                    <feFuncB type="table" tableValues="0 1 1 0" />
                </feComponentTransfer>
            </filter>
            <filter id="Linear">
                <feComponentTransfer>
                    <feFuncR type="linear" slope=".5" intercept=".25" />
                    <feFuncG type="linear" slope=".5" intercept="0" />
                    <feFuncB type="linear" slope=".5" intercept=".5" />
                </feComponentTransfer>
            </filter>
            <filter id="Gamma">
                <feComponentTransfer>
                    <feFuncR type="gamma" amplitude="2" exponent="5" offset="0" />
                    <feFuncG type="gamma" amplitude="2" exponent="3" offset="0" />
                    <feFuncB type="gamma" amplitude="2" exponent="1" offset="0" />
                </feComponentTransfer>
            </filter>
        </defs>
        <g font-size="50" font-weight="bold" fill="url(#MyGrad)">
            <text x="50" y="60" filter="url(#Identity)">Identity</text>
            <text x="50" y="120" filter="url(#Table)">TableLookup</text>
            <text x="50" y="180" filter="url(#Linear)">LinearFunc</text>
            <text x="50" y="240" filter="url(#Gamma)">GammaFunc</text>
        </g>
    </svg>
</body>

</html>